//订单
import http from "@/utils/http";
import {EnumAlias} from "@/utils/common";
//分页
export function orderPage(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/page`,
    method: "get",
    params
    //   cancelToken: new axios.CancelToken((c) => {
    //     data.cancelFun = c
    // }),
  });
}
//获取结算订单信息
export function orderGetOrderSettlementInfo(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/getOrderSettlementInfo`,
    method: "post",
    data
  });
}
//创建订单
export function orderCreateOrder(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/createOrder`,
    method: "post",
    data
  });
}
//修改订单
export function orderUpdate(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/update`,
    method: "post",
    data
  });
}
//删除
export function orderDelete(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/delete`,
    method: "post",
    data
  });
}
//详情
export function orderDetail(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/detail`,
    method: "get",
    params
  });
}
//list
export function orderList(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/list`,
    method: "get",
    params
  });
}
//确认收货
export function orderConfirmReceipt(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/confirmReceipt`,
    method: "post",
    data
  });
}
//订单审核
export function orderAuditOrder(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/auditOrder`,
    method: "post",
    data
  });
}
//发货
export function orderBatchDelivery(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/batchDelivery`,
    method: "post",
    data
  });
}
//订单发票
export function orderUpdateOrderInvioce(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/updateOrderInvioce`,
    method: "post",
    data
  });
}
//财务日志记录
export function orderCreateorderFinanceLog(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/createorderFinanceLog`,
    method: "post",
    data
  });
}
//批量导出订单信息
export function orderExportOrders(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/exportOrders`,
    method: "post",
    data
  });
}
//修改地址信息
export function orderUpdateAddress(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/UpdateAddress`,
    method: "post",
    data
  });
}
//校验地址信息
export function orderCheckIsFreePostage(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/CheckIsFreePostage`,
    method: "post",
    data
  });
}
//修改订单商品数量支付方式
export function orderSubmitUpdateOrderInfo(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/submitUpdateOrderInfo`,
    method: "post",
    data
  });
}
//修改订单商品数量支付方式校验
export function orderGetUpdateOrderProduct(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/getUpdateOrderProduct`,
    method: "post",
    data
  });
}
//订单同步SAP
export function orderOrderSyncSap(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/orderSyncSap`,
    method: "post",
    data
  });
}
//导入发货单
export function importBatchDelivery(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/importBatchDelivery`,
    method: "post",
    data
  });
}
//删除发票
export function delOrderInvioce(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/order/delOrderInvioce`,
    method: "post",
    data
  });
}
